package cn.maihe.elg.operation.repository.entity;

import cn.maihe.elg.operation.repository.entity.BidCustomerVo;
import cn.maihe.framework.starter.base.sql.BaseEntity;
import cn.maihe.framework.starter.base.sql.MapperInterface;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
import java.util.Date;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 投保客户信息
 */
@TableName("t_bid_customer")
@NoArgsConstructor
@AllArgsConstructor
@Data
@Builder
@MapperInterface("cn.maihe.elg.operation.repository.mapper.BidCustomerMapper")
public class BidCustomerDO extends BaseEntity {
    /**
     * 主键
     */
    @TableId(type = IdType.ID_WORKER)
    private Long id;

    /**
     * 交易中心组建
     */
    @TableField(value = "center_id")
    private Long centerId;

    /**
     * 机构主键id
     */
    @TableField(value = "org_id")
    private Long orgId;

    /**
     * 投保客户企业名称
     */
    @TableField(value = "bidder_name")
    private String bidderName;

    /**
     * 投保客户统一社会信用代码
     */
    @TableField(value = "bidder_credit_code")
    private String bidderCreditCode;

    /**
     * 经营范围
     */
    @TableField(value = "bidder_business")
    private String bidderBusiness;

    /**
     * 投保客户联系人名称
     */
    @TableField(value = "bidder_contact_name")
    private String bidderContactName;

    /**
     * 投保客户联系人电话
     */
    @TableField(value = "bidder_contact_tel")
    private String bidderContactTel;

    /**
     * 投保客户联系人证件号码
     */
    @TableField(value = "bidder_contact_idcard")
    private String bidderContactIdcard;

    /**
     * 投保客户联系人证件类型数据字典值
     */
    @TableField(value = "bidder_contact_idcard_type")
    private String bidderContactIdcardType;

    /**
     * 投保客户email
     */
    @TableField(value = "bidder_eamil")
    private String bidderEamil;

    /**
     * 投保客户联系地址
     */
    @TableField(value = "bidder_address")
    private String bidderAddress;

    /**
     * 投保客户法人姓名
     */
    @TableField(value = "legal_person_name")
    private String legalPersonName;

    /**
     * 投保客户法人证件号码
     */
    @TableField(value = "legal_person_idcard")
    private String legalPersonIdcard;

    /**
     * 投保客户法人证件类型数据字典
     */
    @TableField(value = "legal_person_idcard_type")
    private String legalPersonIdcardType;

    /**
     * 投保客户法人联系电话
     */
    @TableField(value = "legal_person_tel")
    private String legalPersonTel;

    /**
     * 是否自动审批 0否 1是
     */
    @TableField(value = "enable_auto_approve")
    private Integer enableAutoApprove;

    /**
     * 是否黑名单 0后 1是
     */
    @TableField(value = "blacklist_flag")
    private Integer blacklistFlag;

    /**
     * 创建时间
     */
    @TableField(value = "gmt_create", fill = FieldFill.INSERT)
    private Date gmtCreate;

    /**
     * 更新时间
     */
    @TableField(value = "gmt_modified", fill = FieldFill.INSERT_UPDATE)
    private Date gmtModified;

    /**
     * 创建用户
     */
    @TableField(value = "user_create", fill = FieldFill.INSERT)
    private String userCreate;

    /**
     * 更新用户
     */
    @TableField(value = "user_modified", fill = FieldFill.INSERT_UPDATE)
    private String userModified;

    /**
     * 注册资本
     */
    @TableField(value = "bidder_capital")
    private String bidderCapital;

    /**
     * 法定代表人
     */
    @TableField(value = "bidder_legal")
    private String bidderLegal;

    /**
     * 营业执照开始时间
     */
    @TableField(value = "bidder_begin_date")
    private String bidderBeginDate;

    /**
     * 营业执照结束时间
     */
    @TableField(value = "bidder_end_date")
    private String bidderEndDate;

    /**
     * 注册地址
     */
    @TableField(value = "bidder_reg_address")
    private String bidderRegAddress;

    /**
     * 企业网址
     */
    @TableField(value = "bidder_website")
    private String bidderWebsite;

    /**
     * ipc备案号
     */
    @TableField(value = "bidder_ipc_no")
    private String bidderIpcNo;

    /**
     * 法人证件开始时间
     */
    @TableField(value = "legal_begin_date")
    private String legalBeginDate;

    /**
     * 法人证件结束时间
     */
    @TableField(value = "legal_end_date")
    private String legalEndDate;

    /**
     * 开户许可证-企业名称
     */
    @TableField(value = "license_name")
    private String licenseName;

    /**
     * 开户许可证-企业对公账户
     */
    @TableField(value = "license_account")
    private String licenseAccount;

    /**
     * 开户许可证-法人
     */
    @TableField(value = "license_legal")
    private String licenseLegal;

    /**
     * 开户许可证-企业开户银行
     */
    @TableField(value = "license_bank")
    private String licenseBank;

    /**
     * 开户许可证-核准号
     */
    @TableField(value = "license_check_no")
    private String licenseCheckNo;

    /**
     * 开户许可证-编号
     */
    @TableField(value = "license__no")
    private String licenseNo;

    /**
     * 审核状态 0注册 1正常 2待内部审核 3待第三方审核 4审核不通过 5 删除
     */
    @TableField(value = "status")
    private Integer status;

    /**
     * 审核备注
     */
    @TableField(value = "audit_desc")
    private String auditDesc;

    /**
     * 投保人单位id 对应user信息中的unitid
     */
    @TableField(value = "follow_id")
    private String followId;

    /**
     * 备案地区编码,如350181、x00004，必填
     */
    @TableField(value = "beiandiqu_code")
    private String beiandiquCode;

    /**
     * 投保企业基本户开户银行名称
     */
    @TableField(value = "bank_name")
    private String bankName;

    /**
     * 投保企业基本户银行卡号
     */
    @TableField(value = "bank_card_num")
    private String bankCardNum;

    /**
     * 投保企业基本户名称
     */
    @TableField(value = "bank_user_name")
    private String bankUserName;

    /**
     * 公司联系电话区号
     */
    @TableField(value = "com_tel_area")
    private String comTelArea;

    /**
     * 公司联系电话
     */
    @TableField(value = "com_tel_num")
    private String comTelNum;

    /**
     * 投保人所在省行政区划代码
     */
    @TableField(value = "province")
    private String province;

    /**
     * 投保人所在市行政区划代码
     */
    @TableField(value = "city")
    private String city;

    /**
     * 投保人所在区行政区划代码
     */
    @TableField(value = "district")
    private String district;

    /**
     * 创建渠道企业返回的企业Id
     */
    @TableField(value = "enterprise_id")
    private Long enterpriseId;

    /**
     * 渠道创建结果查询次数
     */
    @TableField(value = "result_query_times")
    private Integer resultQueryTimes;

    /**
     * 投保人资质级别1级2级
     */
    @TableField(value = "bidder_level")
    private String bidderLevel;

    /*
     * 客户信息补全标识  1：已补全，0：待补全
     * */
    @TableField(value = "complete_flag")
    private Integer completeFlag;

    public BidCustomerVo buildVo() {
        return new BidCustomerVo(id, centerId, orgId, bidderName, bidderCreditCode, bidderBusiness, bidderContactName, bidderContactTel, bidderContactIdcard, bidderContactIdcardType, bidderEamil, bidderAddress, legalPersonName, legalPersonIdcard, legalPersonIdcardType, legalPersonTel, enableAutoApprove, blacklistFlag, gmtCreate, gmtModified, userCreate, userModified, bidderCapital, bidderLegal, bidderBeginDate, bidderEndDate, bidderRegAddress, bidderWebsite, bidderIpcNo, legalBeginDate, legalEndDate, licenseName, licenseAccount, licenseLegal, licenseBank, licenseCheckNo, licenseNo, status, auditDesc, followId, beiandiquCode, bankName, bankCardNum, bankUserName, comTelArea, comTelNum, province, city, district, enterpriseId, resultQueryTimes, bidderLevel, completeFlag);
    }

    public static BidCustomerDO of(BidCustomerVo vo) {
        return new BidCustomerDO(vo.getId(), vo.getCenterId(), vo.getOrgId(), vo.getBidderName(), vo.getBidderCreditCode(), vo.getBidderBusiness(), vo.getBidderContactName(), vo.getBidderContactTel(), vo.getBidderContactIdcard(), vo.getBidderContactIdcardType(), vo.getBidderEamil(), vo.getBidderAddress(), vo.getLegalPersonName(), vo.getLegalPersonIdcard(), vo.getLegalPersonIdcardType(), vo.getLegalPersonTel(), vo.getEnableAutoApprove(), vo.getBlacklistFlag(), vo.getGmtCreate(), vo.getGmtModified(), vo.getUserCreate(), vo.getUserModified(), vo.getBidderCapital(), vo.getBidderLegal(), vo.getBidderBeginDate(), vo.getBidderEndDate(), vo.getBidderRegAddress(), vo.getBidderWebsite(), vo.getBidderIpcNo(), vo.getLegalBeginDate(), vo.getLegalEndDate(), vo.getLicenseName(), vo.getLicenseAccount(), vo.getLicenseLegal(), vo.getLicenseBank(), vo.getLicenseCheckNo(), vo.getLicenseNo(), vo.getStatus(), vo.getAuditDesc(), vo.getFollowId(), vo.getBeiandiquCode(), vo.getBankName(), vo.getBankCardNum(), vo.getBankUserName(), vo.getComTelArea(), vo.getComTelNum(), vo.getProvince(), vo.getCity(), vo.getDistrict(), vo.getEnterpriseId(), vo.getResultQueryTimes(), vo.getBidderLevel(), vo.getCompleteFlag());
    }
}
